# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=openstego
pkgver=0.8.6
pkgrel=1
groups=('blackarch' 'blackarch-crypto' 'blackarch-stego')
pkgdesc='A tool implemented in Java for generic steganography, with support for password-based encryption of the data.'
arch=('any')
url='https://github.com/syvaidya/openstego/releases'
license=('GPL2')
depends=('java-environment')
source=("https://github.com/syvaidya/$pkgname/releases/download/$pkgname-$pkgver/$pkgname-$pkgver.zip")
sha512sums=('2cf7772b6efd8161a3e99003619f060dd669b95688f6f015174300d23a2291b5aeccc1a03808cbf0dd8b18e1c7f5934c92781e53bc320ea2ff130681f92336d2')

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  rm -rf README

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -Xmx512m -jar /usr/share/$pkgname/lib/$pkgname.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

